package com.itheima03.day14;

/**
 * @author 刘全
 * @date 2021/8/6
 */
public class TestDemo3 {
    public static void main(String[] args) {
        //创建Runnable实现类对象
        MyRunnable mr1 = new MyRunnable();
        //创建Thread对象并将Runnable实现类对象传递进去
        Thread tr1 = new Thread(mr1);
        //调用Thread对象的start方法开启新线程
        MyRunnable mr2 = new MyRunnable();
        Thread tr2 = new Thread(mr2);
        tr1.setName("憨丕");
        tr2.setName("武儿");
        tr1.start();
        tr2.start();

    }
}
